package com.ruan.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 *
 * @TableName spu
 */
@TableName(value ="spu")
@Data
public class Spu implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     *
     */
    private String name;

    /**
     *
     */
    private String picture;

    /**
     *
     */
    private Integer categoryId;

    /**
     * 简述
     */
    private String briefly;

    /**
     * 详情介绍
     */
    private String intro;

    /**
     *
     */
    private String keywords;

    /**
     *
     */
    private Integer collectNum;

    /**
     *
     */
    private Integer commentNum;

    /**
     *
     */
    private Integer isHot;

    /**
     *
     */
    private Integer isRecommend;

    /**
     *
     */
    private Integer isNew;

    /**
     * 状态：0 禁用，1：启用
     */
    private Integer status;

    /**
     *
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     *
     */
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 库存
     */
    private Integer stock;

    /**
     * 库存警告
     */
    private Integer warningStock;

    /**
     * 是否显示库存
     */
    private Integer isStockVisible;

    /**
     * 浏览量
     */
    private Integer view;

    /**
     * 总销量
     */
    private Integer totalSales;

    /**
     * 销售价
     */
    private BigDecimal price;

    /**
     *
     */
    private Integer isAttribute;

    /**
     *
     */
    private Integer sort;

    /**
     *
     */
    private String tags;

    /**
     *
     */
    private Integer shippingType;

    /**
     *
     */
    private BigDecimal shippingFee;

    /**
     *
     */
    private Integer shippingFeeId;

    /**
     *
     */
    private Integer shippingFeeType;

    /**
     *
     */
    private Integer provinceId;

    /**
     *
     */
    private Integer cityId;

    /**
     *
     */
    private Integer areaId;

    /**
     *
     */
    private String addressName;

    /**
     * 市场价
     */
    private BigDecimal marketPrice;

    /**
     * 成本价
     */
    private BigDecimal costPrice;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Spu other = (Spu) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getPicture() == null ? other.getPicture() == null : this.getPicture().equals(other.getPicture()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getBriefly() == null ? other.getBriefly() == null : this.getBriefly().equals(other.getBriefly()))
            && (this.getIntro() == null ? other.getIntro() == null : this.getIntro().equals(other.getIntro()))
            && (this.getKeywords() == null ? other.getKeywords() == null : this.getKeywords().equals(other.getKeywords()))
            && (this.getCollectNum() == null ? other.getCollectNum() == null : this.getCollectNum().equals(other.getCollectNum()))
            && (this.getCommentNum() == null ? other.getCommentNum() == null : this.getCommentNum().equals(other.getCommentNum()))
            && (this.getIsHot() == null ? other.getIsHot() == null : this.getIsHot().equals(other.getIsHot()))
            && (this.getIsRecommend() == null ? other.getIsRecommend() == null : this.getIsRecommend().equals(other.getIsRecommend()))
            && (this.getIsNew() == null ? other.getIsNew() == null : this.getIsNew().equals(other.getIsNew()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getStock() == null ? other.getStock() == null : this.getStock().equals(other.getStock()))
            && (this.getWarningStock() == null ? other.getWarningStock() == null : this.getWarningStock().equals(other.getWarningStock()))
            && (this.getIsStockVisible() == null ? other.getIsStockVisible() == null : this.getIsStockVisible().equals(other.getIsStockVisible()))
            && (this.getView() == null ? other.getView() == null : this.getView().equals(other.getView()))
            && (this.getTotalSales() == null ? other.getTotalSales() == null : this.getTotalSales().equals(other.getTotalSales()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getIsAttribute() == null ? other.getIsAttribute() == null : this.getIsAttribute().equals(other.getIsAttribute()))
            && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()))
            && (this.getTags() == null ? other.getTags() == null : this.getTags().equals(other.getTags()))
            && (this.getShippingType() == null ? other.getShippingType() == null : this.getShippingType().equals(other.getShippingType()))
            && (this.getShippingFee() == null ? other.getShippingFee() == null : this.getShippingFee().equals(other.getShippingFee()))
            && (this.getShippingFeeId() == null ? other.getShippingFeeId() == null : this.getShippingFeeId().equals(other.getShippingFeeId()))
            && (this.getShippingFeeType() == null ? other.getShippingFeeType() == null : this.getShippingFeeType().equals(other.getShippingFeeType()))
            && (this.getProvinceId() == null ? other.getProvinceId() == null : this.getProvinceId().equals(other.getProvinceId()))
            && (this.getCityId() == null ? other.getCityId() == null : this.getCityId().equals(other.getCityId()))
            && (this.getAreaId() == null ? other.getAreaId() == null : this.getAreaId().equals(other.getAreaId()))
            && (this.getAddressName() == null ? other.getAddressName() == null : this.getAddressName().equals(other.getAddressName()))
            && (this.getMarketPrice() == null ? other.getMarketPrice() == null : this.getMarketPrice().equals(other.getMarketPrice()))
            && (this.getCostPrice() == null ? other.getCostPrice() == null : this.getCostPrice().equals(other.getCostPrice()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getPicture() == null) ? 0 : getPicture().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getBriefly() == null) ? 0 : getBriefly().hashCode());
        result = prime * result + ((getIntro() == null) ? 0 : getIntro().hashCode());
        result = prime * result + ((getKeywords() == null) ? 0 : getKeywords().hashCode());
        result = prime * result + ((getCollectNum() == null) ? 0 : getCollectNum().hashCode());
        result = prime * result + ((getCommentNum() == null) ? 0 : getCommentNum().hashCode());
        result = prime * result + ((getIsHot() == null) ? 0 : getIsHot().hashCode());
        result = prime * result + ((getIsRecommend() == null) ? 0 : getIsRecommend().hashCode());
        result = prime * result + ((getIsNew() == null) ? 0 : getIsNew().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getStock() == null) ? 0 : getStock().hashCode());
        result = prime * result + ((getWarningStock() == null) ? 0 : getWarningStock().hashCode());
        result = prime * result + ((getIsStockVisible() == null) ? 0 : getIsStockVisible().hashCode());
        result = prime * result + ((getView() == null) ? 0 : getView().hashCode());
        result = prime * result + ((getTotalSales() == null) ? 0 : getTotalSales().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getIsAttribute() == null) ? 0 : getIsAttribute().hashCode());
        result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
        result = prime * result + ((getTags() == null) ? 0 : getTags().hashCode());
        result = prime * result + ((getShippingType() == null) ? 0 : getShippingType().hashCode());
        result = prime * result + ((getShippingFee() == null) ? 0 : getShippingFee().hashCode());
        result = prime * result + ((getShippingFeeId() == null) ? 0 : getShippingFeeId().hashCode());
        result = prime * result + ((getShippingFeeType() == null) ? 0 : getShippingFeeType().hashCode());
        result = prime * result + ((getProvinceId() == null) ? 0 : getProvinceId().hashCode());
        result = prime * result + ((getCityId() == null) ? 0 : getCityId().hashCode());
        result = prime * result + ((getAreaId() == null) ? 0 : getAreaId().hashCode());
        result = prime * result + ((getAddressName() == null) ? 0 : getAddressName().hashCode());
        result = prime * result + ((getMarketPrice() == null) ? 0 : getMarketPrice().hashCode());
        result = prime * result + ((getCostPrice() == null) ? 0 : getCostPrice().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", picture=").append(picture);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", briefly=").append(briefly);
        sb.append(", intro=").append(intro);
        sb.append(", keywords=").append(keywords);
        sb.append(", collectNum=").append(collectNum);
        sb.append(", commentNum=").append(commentNum);
        sb.append(", isHot=").append(isHot);
        sb.append(", isRecommend=").append(isRecommend);
        sb.append(", isNew=").append(isNew);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", stock=").append(stock);
        sb.append(", warningStock=").append(warningStock);
        sb.append(", isStockVisible=").append(isStockVisible);
        sb.append(", view=").append(view);
        sb.append(", totalSales=").append(totalSales);
        sb.append(", price=").append(price);
        sb.append(", isAttribute=").append(isAttribute);
        sb.append(", sort=").append(sort);
        sb.append(", tags=").append(tags);
        sb.append(", shippingType=").append(shippingType);
        sb.append(", shippingFee=").append(shippingFee);
        sb.append(", shippingFeeId=").append(shippingFeeId);
        sb.append(", shippingFeeType=").append(shippingFeeType);
        sb.append(", provinceId=").append(provinceId);
        sb.append(", cityId=").append(cityId);
        sb.append(", areaId=").append(areaId);
        sb.append(", addressName=").append(addressName);
        sb.append(", marketPrice=").append(marketPrice);
        sb.append(", costPrice=").append(costPrice);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
